From: Ævar Arnfjörð Bjarmason Date: Tue, 6 Jul 2010 21:34:20 +0000 (+0000) Subject: new-installer: Make findExtensions() return a key-value array X-Git-Tag: 1.31.0-rc.0~36235 X-Git-Url: http://git.cyclocoop.org/%22.%24info%5B?a=commitdiff_plain;h=83ff1577b70b90bef3d50180f66310762d6fe985;p=lhc%2Fweb%2Fwiklou.git new-installer: Make findExtensions() return a key-value array Now we return e.g.: array( 'Cite', 'LiquidThreads' ); Instead return: array( 'Cite' => null, 'LiquidThreads' => $some_config ); Where $some_config is a yet-to-be determined configuration. It's intended for e.g. sourcing SQL tables that the extension needs. --- diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index 4124028ddd..9ab53fa747 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -844,7 +844,7 @@ abstract class Installer { $dh = opendir( $dir ); while ( ( $file = readdir( $dh ) ) !== false ) { if( file_exists( "$dir/$file/$file.php" ) ) { - $exts[] = $file; + $exts[$file] = null; } } $this->setVar( '_Extensions', $exts ); diff --git a/includes/installer/WebInstaller.php b/includes/installer/WebInstaller.php index c5bc3dd855..ff6609ae8f 100644 --- a/includes/installer/WebInstaller.php +++ b/includes/installer/WebInstaller.php @@ -1387,7 +1387,7 @@ class WebInstaller_Options extends WebInstallerPage { $extensions = $this->parent->findExtensions(); if( $extensions ) { $extHtml = $this->parent->getFieldsetStart( 'config-extensions' ); - foreach( $extensions as $ext ) { + foreach( array_keys($extensions) as $ext ) { $extHtml .= $this->parent->getCheckBox( array( 'var' => "ext-$ext", 'rawtext' => $ext,